package com.wclass.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableLogic;
import com.baomidou.mybatisplus.annotations.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.util.List;

/**
 * <p>
 * 帖子回复
 * </p>
 *
 * @author SEN
 * @since 2018-12-27
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("posts_reply")
@SuppressWarnings("serial")
public class PostsReply extends SuperEntity<PostsReply> {


    /**
     * 是否删除 0：有效，1：禁用
     */
    @JSONField(serialize = false)
    @TableLogic
    private Integer state = 0;
    /**
     * 评论内容
     */
    @ApiModelProperty("评论内容")
    private String content;
    /**
     * 评论人
     */
    @ApiModelProperty("评论人")
    @TableField("user_id")
    private Long userId;
    /**
     * 上级id
     */
    @ApiModelProperty("上级id")
    @TableField("p_id")
    private Long pId;
    /**
     * 帖子id
     */
    @ApiModelProperty("帖子id")
    @TableField("posts_id")
    private Long postsId;

    @ApiModelProperty("评论用户昵称")
    @TableField(value = "nick_name", exist = false)
    private String nickName;

    @ApiModelProperty("评论用户头像")
    @TableField(value = "picture_address", exist = false)
    private String pictureAddress;

    @ApiModelProperty("0：未读信息，1：已读信息")
    @TableField("is_new")
    private Integer isNew;

    @ApiModelProperty("被评论用户昵称")
    @TableField(exist = false)
    private String beCommentName;

    @ApiModelProperty("被评论内容")
    @TableField(exist = false)
    private String beCommentContent;

    @ApiModelProperty("子评论列表")
    @TableField(exist = false)
    private List<PostsReply> childReplyList;

}
